Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add loop component 🎁🎄 #5429

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

feat: add loop component 🎁🎄 #5429

wants to merge 10 commits into from

Conversation

rodrigosnader
Copy link
Contributor

@rodrigosnader rodrigosnader commented Dec 24, 2024

This pull request introduces the LoopComponent to the Langflow backend and includes corresponding tests and configuration updates. The most important changes include adding the new component, updating the initialization and configuration files, and creating tests for the new component.

Adding the LoopComponent:

Updating custom component functionality:

Configuration updates for tests:

Adding tests for LoopComponent:

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels Dec 24, 2024
@severfire
Copy link

Oh, I wonder how it would work, can't wait to test it :-)

Thanks for great work!

@ogabrielluiz ogabrielluiz changed the title add loop component 🎁🎄 feat: add loop component 🎁🎄 Jan 6, 2025
@ogabrielluiz ogabrielluiz requested a review from Copilot January 6, 2025 18:53
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

src/backend/base/langflow/components/logic/loop.py Outdated Show resolved Hide resolved
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 6, 2025
@edwinjosechittilappilly
Copy link
Collaborator

The component works well in UI,
But gives error with the API.

Test case: #5615

rodrigosnader and others added 6 commits January 10, 2025 12:56
- Renamed 'loop' input to 'loop_input' for clarity.
- Simplified logic for checking loop input and aggregating results.
- Enhanced type hints for better code readability and maintainability.
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 10, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 13, 2025
@edwinjosechittilappilly
Copy link
Collaborator

Error in number of times the loops are executed.
Hence Having a Fix PR to solve this issue.

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 14, 2025
@edwinjosechittilappilly
Copy link
Collaborator

updated component with issue fixes: #5615
@italojohnny

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 14, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 14, 2025
… Loop component updates to support API (#5615)

* add loop component 🎁🎄

* [autofix.ci] apply automated fixes

* fix: add loop component to init

* [autofix.ci] apply automated fixes

* refactor(loop): rename loop input variable and improve code quality

- Renamed 'loop' input to 'loop_input' for clarity.
- Simplified logic for checking loop input and aggregating results.
- Enhanced type hints for better code readability and maintainability.

* refactor(loop): add type hint to initialize_data method for improved clarity

* adding test

* test cases added

* Update test_loop.py

* adding test

* test cases added

* Update test_loop.py

* update with the new test case method!

* Update test_loop.py

* tests  updates

* Update loop.py

* update fix

* issues loop issues

* reverting debug mode params

* solves lint errors and fix the tests

* fix: mypy error incompatible return value type

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Rodrigo Nader <rodrigosilvanader@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jan 14, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 14, 2025
Copy link

codspeed-hq bot commented Jan 14, 2025

CodSpeed Performance Report

Merging #5429 will degrade performances by 25.59%

Comparing loop-component (8b9d289) with main (0d1c291)

Summary

❌ 1 regressions
✅ 14 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main loop-component Change
test_successful_run_with_output_type_any 238.9 ms 321.1 ms -25.59%

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 14, 2025
@edwinjosechittilappilly
Copy link
Collaborator

@italojohnny Do you know why the CI Fails?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lgtm This PR has been approved by a maintainer size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants